package com.polkawallet;

import android.app.Application;

import com.facebook.react.ReactApplication;
import com.rnfs.RNFSPackage;
import fr.bamlab.rncameraroll.CameraRollPackage;
import fr.greweb.reactnativeviewshot.RNViewShotPackage;
import cn.reactnative.modules.update.UpdatePackage;
import com.tradle.react.UdpSocketsModule;
import com.rnfingerprint.FingerprintAuthPackage;
import com.peel.react.TcpSocketsModule;
import com.horcrux.svg.SvgPackage;
import br.com.classapp.RNSensitiveInfo.RNSensitiveInfoPackage;
import li.yunqi.rnsecurestorage.RNSecureStoragePackage;
import com.bitgo.randombytes.RandomBytesPackage;
import com.lewin.qrcode.QRScanReaderPackage;
import com.peel.react.rnos.RNOSModule;
import cn.jystudio.local.barcode.recognizer.LocalBarcodeRecognizerPackage;
import com.imagepicker.ImagePickerPackage;
import com.AlexanderZaytsev.RNI18n.RNI18nPackage;
import org.reactnative.camera.RNCameraPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;

import java.util.Arrays;
import java.util.List;

public class MainApplication extends Application implements ReactApplication {

  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
    @Override
    public boolean getUseDeveloperSupport() {
      return BuildConfig.DEBUG;
    }

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
            new RNFSPackage(),
            new CameraRollPackage(),
            new RNViewShotPackage(),
            new UpdatePackage(),
            new UdpSocketsModule(),
            new FingerprintAuthPackage(),
            new TcpSocketsModule(),
            new SvgPackage(),
            new RNSensitiveInfoPackage(),
            new RNSecureStoragePackage(),
            new RandomBytesPackage(),
            new QRScanReaderPackage(),
            new RNOSModule(),
            new LocalBarcodeRecognizerPackage(),
            new ImagePickerPackage(),
            new RNI18nPackage(),
            new RNCameraPackage()
      );
    }

    @Override
    protected String getJSMainModuleName() {
      return "index";
    }
  };

  @Override
  public ReactNativeHost getReactNativeHost() {
    return mReactNativeHost;
  }

  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
  }
}
